<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition>
			<f:event listener="#{locationController.init}"
				type="preRenderComponent"></f:event>
			<p:dialog header="#{msgs.pleaseChoosePickupLocation}" id="pickupLocationDialog"
				widgetVar="pickupLocationDlg" modal="true" showEffect="explode"
				hideEffect="clip" width="450" height="280" style="font-size:0.7em">
				<h:form>
					<p:dataTable var="location" value="#{locationModel.list}"
						rowKey="#{location.id}"	selection="#{userModel.authenticatedUser.dropOffLocation}">
						<p:ajax event="rowSelect" update=":centerForm"></p:ajax>
						<p:column selectionMode="single" style="width:25px" />						
						<p:column headerText="address" sortBy="#{location.address}" style="width:200px">
							<h:outputText value="#{location.address}" />
						</p:column>
						<p:column headerText="district" sortBy="#{location.district}" style="width:150px">
							<h:outputText value="#{location.district}" />
						</p:column>
						<p:column headerText="Post code" sortBy="#{location.postCode}" style="width:150px" >
							<h:outputText value="#{location.postCode}" />
						</p:column>
						<p:column headerText="name" sortBy="#{location.name}" style="width:250px">
							<h:outputText value="#{location.name}" />
						</p:column>

					</p:dataTable>
					<p:commandButton value="#{msgs.ok}" type="button" onclick="pickupLocationDlg.hide()" style="float:right"></p:commandButton>
				</h:form>
			</p:dialog>
		</ui:composition>
	</body>
</f:view>
</html>